package model.dba;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public abstract class JDBC {
	enum TipoConsulta {
		Select, Ejecucion
	}

	protected Statem<JDBC> stat = new Statem<JDBC>();
	protected PreparedStatement preparedStatement;
	protected ResultSet resultSet;
	protected Connection connection;

	protected JDBC() {

		this.preparedStatement = null;
		this.resultSet = null;
		try {
			this.connection = getConnection();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	private Connection getConnection() throws SQLException {

		Connection conn = ConnectionFactory.getInstance().getConnection();
		return conn;
	}

}
